package cn.guoxuepeng.hrm.service.impl;

import cn.guoxuepeng.hrm.domain.CourseDetail;
import cn.guoxuepeng.hrm.mapper.CourseDetailMapper;
import cn.guoxuepeng.hrm.service.ICourseDetailService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author gxp
 * @since 2020-06-22
 */
@Service
public class CourseDetailServiceImpl extends ServiceImpl<CourseDetailMapper, CourseDetail> implements ICourseDetailService {

    /**
     * 根据课程id查询课程简介和详情
     * @param id
     * @return
     */
    @Override
    public CourseDetail getDetailByCourseId(Long id) {
        return baseMapper.selectOne(new QueryWrapper<CourseDetail>().eq("course_id",id));
    }
}
